﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Thongtincanhan : System.Web.UI.Page
{
    Control ctleft, ctright, ctopright;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["ChildrenLogin"] != null || Session["TeacherLogin"] != null)
        {
            if (Session["ChildrenLogin"] != null)
            {
                Hienthiphuhuynh();
            }
            else if (Session["TeacherLogin"] != null)
            {
                Hienthigiaovien();
            }
        }
        else
        {
            if (Request.QueryString.Get("gv") == null)
            {
                Response.Redirect("dangnhap.aspx");
            }
            else Response.Redirect("dangnhap.aspx?gv=1");
        }
    }
    public void Hienthiphuhuynh()
    {
        ctleft = Page.LoadControl("Controls/ucLeftphuhuynh.ascx");
        ctright = Page.LoadControl("Controls/ucThongtincanhanphuhuynh.ascx");
        ctopright = Page.LoadControl("Controls/ucToprightphuhuynh.ascx");
        plhleft.Controls.Add(ctleft);
        plhright.Controls.Add(ctopright);
        plhright.Controls.Add(ctright);
    }
    public void Hienthigiaovien()
    {
        ctleft = Page.LoadControl("Controls/ucLeftgiaovien.ascx");
        ctright = Page.LoadControl("Controls/ucThongtincanhangiaovien.ascx");
        ctopright = Page.LoadControl("Controls/ucToprightphuhuynh.ascx");
        plhleft.Controls.Add(ctleft);
        plhright.Controls.Add(ctopright);
        plhright.Controls.Add(ctright);
    }
}